package com.innjia.sys.service;

import com.innjia.base.utils.PageUtils;
import com.innjia.sys.entity.HouseEntity;

import java.util.List;
import java.util.Map;

/**
 * 房源信息模型
 * 
 * @author innjia
 * @email huangxianyuan@gmail.com
 * @date 2017-11-13 19:07:07
 */
public interface HouseService {
	
	HouseEntity queryObject(String id);
	
	List<HouseEntity> queryList(Map<String, Object> map);

    List<HouseEntity> queryListByBean(HouseEntity entity);
	
	int queryTotal(Map<String, Object> map);
	
	int save(HouseEntity house);
	
	int update(HouseEntity house);
	
	int delete(String id);
	
	int deleteBatch(String[] ids);

	HouseEntity houseInfo(String id);

	//房东申请房屋出租
	String apply(HouseEntity entity);
	
	HouseEntity getLatestHouse();

	//后台创建房源
	String create(HouseEntity houseEntity);

	//根据序列号获取房源
	HouseEntity findHouseBySerialNum(String serialNum);
	
	//条件分页查询
	List<HouseEntity> queryListByBeanPage(HouseEntity entity, PageUtils pageUtils);
	
	HouseEntity queryDetailById(String houseId);

	List<HouseEntity> queryChildrenByParentId(String parentId);

	void reset(HouseEntity houseEntity, HouseEntity oldHouse);

	HouseEntity getHouseById(String houseId);

	void updateRentStatus(HouseEntity house, String rentStatus);

	//查询app需要的房源列表
	List<HouseEntity> queryAppList(HouseEntity houseEntity, PageUtils pageUtils);

	//判断房源是否有合同在身
	boolean isHouseWithContract(String houseId);
	
	//根据房东id分頁查询房东名下备案通过的房源列表
	List<HouseEntity> queryListByLandlordId(String landlordId, PageUtils pageUtils);
	
	/**
	 * 根据房源id更新房态
	 * @param houseId
	 * @param rentStatus
	 * @return
	 * boolean
	 */
	boolean updateRentStatusByHouseId(String houseId, String rentStatus);
	
	
	/**
	 * 对房源列表中的所有房源中的房东中的手机号码以及ownerPhone进行脱敏
	 * @param houses
	 * @return
	 */
	List<HouseEntity> transferAllPhones(List<HouseEntity> houses);

	int deleteHouse(HouseEntity houseEntity);
}
